//
// Created by liaojili on 2023/11/9.
//

#include <stdio.h>
#include <string.h>

#define ARRAY_SIZE 5

void main() {

    int arr1[ARRAY_SIZE] = {1, 3, 5, 6, 8};
    int arr2[ARRAY_SIZE];
    // 参数依次为目标数组、源数组以及要复制的字节数
    memcpy(arr2, arr1, ARRAY_SIZE * sizeof(int));

    for (int i = 0; i < ARRAY_SIZE; ++i) {
        printf("%d\n", arr2[i]);
    }
}
